/*
 * FaceCat图形通讯框架
 * 著作权编号:2015SR229355+2020SR0266727
 * 上海卷卷猫信息技术有限公司
 */

using System;
using System.Collections.Generic;

namespace FaceCat {
    /// <summary>
    /// 年
    /// </summary>
    [Serializable()]
    public class CYear {
        /// <summary>
        /// 创建年
        /// </summary>
        /// <param name="year">年份</param>
        public CYear(int year) {
            m_year = year;
            CreateMonths();
        }

        private HashMap<int, CMonth> m_months = new HashMap<int, CMonth>();

        /// <summary>
        /// 获取或设置月的集合
        /// </summary>
        public virtual HashMap<int, CMonth> getMonths() {
            return m_months;
        }

        private int m_year;

        /// <summary>
        /// 获取年份
        /// </summary>
        public virtual int getYear() {
            return m_year;
        }

        /// <summary>
        /// 创建月
        /// </summary>
        private void CreateMonths() {
            for (int i = 1; i <= 12; i++) {
                m_months.put(i, new CMonth(m_year, i));
            }
        }

        /// <summary>
        /// 清除数据
        /// </summary>
        public virtual void delete() {
            foreach (CMonth month in m_months.Values) {
                month.delete();
            }
            m_months.clear();

        }
    }
}
